package cn.xiaopengstack.domain.trade.service;

import cn.xiaopengstack.domain.trade.model.entity.*;

import java.util.Optional;

/**
 * 拼团下单服务
 * @author jiangyangang
 */
public interface ITradeLockOrderService {

    /**
     * 查询，未被支付的拼团订单
     * @param userId
     * @param outTradeNo
     * @return
     */
    Optional<MarketOrderEntity> queryUnPayMarketPayOrder(String userId, String outTradeNo);

    /**
     * 查询拼单进度
     * @param teamId 拼团队伍ID
     * @return
     */
    Optional<ProgressEntity> queryGoodsGroupByProgress(String teamId);


    /**
     * 锁定拼团订单
     * @param userEntity
     * @param payGoodsEntity
     * @param discountEntity
     * @return
     */
    MarketOrderEntity lockGroupBuyMarketOrder(UserEntity userEntity, PayActivityEntity payGoodsEntity, PayDiscountEntity discountEntity) throws Exception;


}
